from django.conf import settings
from django.conf.urls.static import static
from django.urls import path, include
from .views import *

app_name = 'main'

urlpatterns = [
    path('', ArticleView.as_view(), name='index'),
    path('article/<int:pk>', ArticleDetailView.as_view(), name='article_detail'),
    path('search/', include('haystack.urls')),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
